package com.ddc.drivers.fmpxml;

import java.sql.ResultSetMetaData;
import java.sql.SQLException;

public class FmResultSetMetaData implements ResultSetMetaData {
	private FmFieldList fieldDefinitions;

	public FmResultSetMetaData(FmFieldList fieldDefinitions) {
		this.fieldDefinitions = fieldDefinitions;
	}

	//---These methods must be implemented---
	public int getColumnCount() throws SQLException {
		return fieldDefinitions.getFields().size();
	}

	public String getColumnLabel( int i ) throws SQLException {
		//SB MOD
		//throw new AbstractMethodError( "getColumnLabel is not implemented yet." ); //FIX!!! Broken placeholder
		return "";
	}

	public String getColumnName( int i ) throws SQLException {
		return fieldDefinitions.get(i - 1).getColumnName();
	}

	public int getColumnType( int i ) throws SQLException {
		//SB MOD
		//throw new AbstractMethodError( "getColumnType is not implemented yet." ); //FIX!!! Broken placeholder
		return 0;
	}

	public String getColumnTypeName( int i ) throws SQLException {
		throw new AbstractMethodError( "getColumnTypeName is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public String getColumnClassName( int i ) throws SQLException {
		throw new AbstractMethodError( "getColumnClassName is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public int getPrecision( int i ) throws SQLException {
		throw new AbstractMethodError( "getPrecision is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public int getScale( int i ) throws SQLException {
		throw new AbstractMethodError( "getScale is not implemented yet." ); //FIX!!! Broken placeholder
	}


	//---These can be left abstract for now---

	public boolean isAutoIncrement( int i ) throws SQLException {
		throw new AbstractMethodError( "isAutoIncrement is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isCaseSensitive( int i ) throws SQLException {
		throw new AbstractMethodError( "isCaseSensitive is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isSearchable( int i ) throws SQLException {
		throw new AbstractMethodError( "isSearchable is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isCurrency( int i ) throws SQLException {
		throw new AbstractMethodError( "isCurrency is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public int isNullable( int i ) throws SQLException {
		throw new AbstractMethodError( "isNullable is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isSigned( int i ) throws SQLException {
		throw new AbstractMethodError( "isSigned is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public int getColumnDisplaySize( int i ) throws SQLException {
		throw new AbstractMethodError( "getColumnDisplaySize is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public String getSchemaName( int i ) throws SQLException {
		throw new AbstractMethodError( "getSchemaName is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public String getTableName( int i ) throws SQLException {
		throw new AbstractMethodError( "getTableName is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public String getCatalogName( int i ) throws SQLException {
		throw new AbstractMethodError( "getCatalogName is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isReadOnly( int i ) throws SQLException {
		throw new AbstractMethodError( "isReadOnly is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isWritable( int i ) throws SQLException {
		throw new AbstractMethodError( "isWritable is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isDefinitelyWritable( int i ) throws SQLException {
		throw new AbstractMethodError( "isDefinitelyWritable is not implemented yet." ); //FIX!!! Broken placeholder
	}

	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		// TODO Auto-generated method stub
		return false;
	}

	public <T> T unwrap(Class<T> iface) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}
}